package com.googlecode.maurersmarbles.drawables;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Paint.Align;
import android.graphics.Rect;

public class SimpleDealerChipDrawable extends DealerChipDrawable {

	/**
	 * The paint to draw the dealer chip.
	 */
	private static final Paint PAINT = new Paint();

	/**
	 * Creates a new SimpleDealerChipDrawable.
	 * @param boundingBox the bounding box to draw the dealer chip in
	 */
	public SimpleDealerChipDrawable(Rect boundingBox) {
		super(boundingBox);
	}

	@Override
	public void drawDealerChip(Canvas canvas, int startX, int startY,
			int width, int height) {

		PAINT.setColor(Color.WHITE);
		canvas.drawCircle(startX + (int) (width / 2.0), startY
				+ (int) (height / 2.0), (float) (width / 2.0), PAINT);

		PAINT.setColor(Color.BLACK);
		PAINT.setTextAlign(Align.CENTER);
		PAINT.setTextSize((int) (width / 1.25));
		int x = (int) (startX + (width / 2.0));
		int y = (int) (startY + ((height / 2.0) - ((PAINT.descent() + PAINT
				.ascent()) / 2.0)));
		canvas.drawText("D", x, y, PAINT);

	}

}
